import Vue from 'vue'
import VueRouter from 'vue-router'
import HomePage from '../views/HomePage'
import DetailsPage from '../views/DetailsPage'
import Article from '../views/Article'
import Collect from '../views/Collect'
import Like from '../views/Like'
import User from '../views/User'

Vue.use(VueRouter)

const routes =[
    {
        path:'/',
        component:HomePage,
        redirect:'article',
        children:[
            {
                path:'article',
                component:Article
            },
            {
                path:'collect',
                component:Collect
            },
            {
                path:'like',
                component:Like
            },
            {
                path:'user',
                component:User
            },
        ]
    },
    {
        path:'/detailspage/:id',
        component:DetailsPage,
    }
]
const router =new VueRouter({
    routes
})

export default router

